<template>
	<view class="login">
		<view class="title">SignalR</view>
		<input type="text" class="input-box" v-model="username" placeholder="请输入账号">
		<button class="login-btn" @click="login">登录</button>
    <view>注: 用来模拟用户登录获取用户名</view>
	</view>
</template>

<script>
	export default {
    name: "Login",
    data () {
      return {
        username : '' // 用户名
      }
    },
	  methods : {
	    login () {
        if (this.username.trim() !== "") {
          uni.setStorageSync('currentUser', this.username);
            uni.switchTab({
              url:'../signalR/signalR'
            });
            return
				}
			}
	  }
	}
</script>

<style lang="scss" scoped>
.login{
		padding-top: 160rpx;
		width:100%;
		height: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	.title {
		height: 100rpx;
		font-size:84rpx;
		text-align: center;
		font-family: Source Han Sans CN;
		font-style: normal;
		font-weight: bold;
		color: #D02129;
		margin-bottom: 80rpx;
	}
	.input-box {
		width:600rpx;
		height: 50rpx;
		margin-bottom: 40rpx;
		padding: 26rpx;
		font-size: 32rpx;
	}
	input{
		border: 1px solid #E0E0E0;
	}
	input::-webkit-input-placeholder{
		color: #999999;
	}
	input::-moz-placeholder{
		color: #999999;
	}
	input::-ms-input-placeholder{
		color: #999999;
	}
	.login-btn{
		width: 680rpx;
		height: 100rpx;
		line-height: 100rpx;
		font-size:36rpx ;
		text-align: center;
		color: #ffffff;
		background: #618DFF;
		outline: none;
		border: 0;
	}
</style>
